import React from "react"
// 4、正确配置项目所需要的路由（封装可配置路由表） 9：04
// 5、考虑资源过多，首屏加载白屏的问题（如：路由懒加载） 9：04

const Home =React.lazy(()=>import("../pages/Home"))
const Login =React.lazy(()=>import("../pages/Login"))
const Tapday =React.lazy(()=>import("../pages/Tapday"))
const Join =React.lazy(()=>import("../pages/Join"))

const Main =React.lazy(()=>import('../pages/Home/Main'))
const Hot =React.lazy(()=>import('../pages/Home/Hot'))
const More =React.lazy(()=>import('../pages/Home/More'))
const Learn =React.lazy(()=>import('../pages/Home/Learn'))
const My =React.lazy(()=>import('../pages/Home/My'))
const Search=React.lazy(()=>import('../pages/Home/Search'))

const footerRouter=[{
    path:'/home/main',
    name:'首页',
    element:<Main/>
},{
    path:'/home/hot',
    name:'沸点',
    element:<Hot/>
},{
    path:'/home/more',
    name:'发现',
    element:<More/>
},{
    path:'/home/learn',
    name:'课程',
    element:<Learn/>
},{
    path:'/home/my',
    name:'我',
    element:<My/>
}]

const routes=[{
    path:'/home',
    element:<Home/>,
    children:footerRouter
},{
    path:'/join',
    element:<Join/>
},{
    path:'/login',
    element:<Login/>
},{
    path:'/tapday',
    element:<Tapday/>
},{
    path:'/search',
    element:<Search/>
},{
    from:'/',
    to:'/home/main'
}]

export {
    footerRouter,
    routes
}